;#############################
;命令：
;nasm -f elf64 day3_0array_0int.asm -o main.o && gcc main.o -o main -lc -no-pie && ./main
;输出：
;Value in arr[0] is 10.
;Value in arr[3] is 43.
;Value in arr[7] is 87.
;#############################
extern printf

section .data
	msg: db `Value in arr[%d] is %d.\n`, 0
	arr: dd 10, 21, 32, 43, 54, 65, 76, 87

section .text
	global main

main:
	push rbp
	mov rbp, rsp

;###################################
	mov rdi, msg
	mov rsi, 0
	mov rdx, [arr + 4 * 0]
	call printf

	mov rdi, msg
	mov rsi, 3
	mov rdx, [arr + 4 * 3]
	call printf

	mov rdi, msg
	mov rsi, 7
	mov rdx, [arr + 4 * 7]
	call printf

;###################################

	mov eax, 0
	leave
	ret
